package com.whty.activemq.web;

//import org.apache.activemq.command.ActiveMQQueue;
//import org.apache.activemq.command.ActiveMQTempQueue;
//import org.apache.activemq.command.ActiveMQTempTopic;
//import org.apache.activemq.command.ActiveMQTopic;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.Qualifier;
//import org.springframework.jms.core.JmsMessagingTemplate;
//import org.springframework.jms.core.JmsTemplate;
//import org.springframework.web.bind.annotation.GetMapping;
//import org.springframework.web.bind.annotation.RequestParam;
//import org.springframework.web.bind.annotation.RestController;
//
//import javax.jms.Destination;


//@RestController
public class TestActiveMqController {
	
//	 private JmsMessagingTemplate jmsTemplate;
//
//	    @Autowired
//	    public void setJmsTemplate(JmsMessagingTemplate jmsTemplate) {
//	        this.jmsTemplate = jmsTemplate;
//	    }
//
//	    @GetMapping("/js/queue")
//	    public void jmsQueueTemplate(@RequestParam String value) {
//	        Destination destination = (Destination) new ActiveMQQueue("queueTest");
//	        this.jmsTemplate.convertAndSend(destination, value);
//	    }
//
//	    @GetMapping("/js/topic")
//	    public void jmsTopicTemplate(@RequestParam String value) {
//	        // 可以将以下步骤封装进service 层, 并暴露出一个 destinationName 和 message 出来
//	        Destination destination = (Destination) new ActiveMQTopic("topicTest");
//	        this.jmsTemplate.convertAndSend(destination, value);
//	    }
//

}
